package com.example.blogapi.controller;

import com.example.blogapi.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiParam;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

@Api(tags = "测试类")
@RestController
@RequestMapping("/test")
public class TestController {
    @GetMapping("/one")
    public Result test(){
        return Result.success("成功登录");
    }
    @PostMapping("/two")
    public Result test2(@RequestHeader("headerOne") String token){
        return Result.success("token:"+token);
    }
    @GetMapping("/three")
    public Result test3(@ApiParam(value = "token字段",required = true) String token){
        return Result.success("token:"+token);
    }
    @GetMapping("/four")
    public Result test4(@ApiParam(value = "账户",required = true) String username,
                        @ApiParam(value = "密码",required = true) String password
                        ){
        return Result.success("username:"+username+"password:"+password);
    }
}
